{extend name="base/common"}

{block name="style"}
<style>
    .mail-box .mail-ontact{
        width: 150px;
        min-width: 150px;
        overflow: hidden;
    }
    .mail-box .mail-subject{
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 124px !important;
        min-width: 124px;
    }
    .mail-subject-div{
        width: 100px;
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mail-box .mail-main{
        width: calc(100% - 460px);
        position: absolute;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mail-date{
        width: 160px;
        min-width: 160px;
        overflow: hidden;
    }
    @media only screen and (max-width: 550px){
        .mail-date{
            display: none;
        }
    }
    .list_banner {width: 80px}
    .list_type {width: 80px}

</style>
{/block}

{block name="page-header"}

{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="mail-box-header">
            <h2>{$company.name}</h2>

        </div>
        <div class="mail-box">
            <table class="table table-hover table-mail">

                <thead>
                <tr>
                    <th style="width:10%"></th>
                    <th style="width:15%">费用类型</th>
                    <th style="width:15%">费用金额</th>
                    <th style="width:15%">到期时间</th>
                    <th style="width:15%">状态</th>


                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo"}
                <tr class="read">
                    <td class="check-mail">
                    </td>
                    <td class="mail-subject">
                        {$vo.type_text}
                    </td>
                    <td>
                        {$vo.fee}
                    </td>
                    <td>
                        {$vo.expiration_time}
                    </td>
                    <td>
                        {eq name="$vo.status" value="1"}
                        <a href="#" class="btn btn-primary" onclick="changeState('{$vo.id}')" style="color:#fff">审核</a>
                        {else/}
                        <button class="btn btn-info" >{$vo.status_text}</button>
                        {/eq}
                    </td>


                </tr>
                {/volist}
                </tbody>
            </table>
            <div class="btn-group pull-right">{$list->render()}</div>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script src="/admin/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function(){
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        $(".check-all").on("ifChanged",function(){
            $("tbody").find(".ids").iCheck("toggle");
        });
    });
    function changeState(id) {
        $.ajax({
            data:{id:id},
            type:"post",
            url:"{:Url('Feepayment/changeState')}",
            success:function (data) {
                if (data.code==1){
                    updateAlert(data.msg,"success");
                    setTimeout(function () {
                        location.href=data.url;
                    },2000);
                }else{
                    updateAlert(data.msg,"info");
                }
            }
        });
    }


</script>
{/block}